package com.ibeetl.cms.service;

import java.util.List;

import com.ibeetl.cms.entity.IndustrialTalents;
import com.ibeetl.cms.entity.Skill;
import com.ibeetl.cms.web.query.ProfessionalTechnologyQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.ibeetl.cms.dao.ProfessionalTechnologyDao;
import com.ibeetl.cms.entity.ProfessionalTechnology;
import com.ibeetl.admin.core.service.BaseService;

/**
 * ProfessionalTechnology Service
 */

@Service
@Transactional
public class ProfessionalTechnologyService extends BaseService<ProfessionalTechnology>{

    @Autowired private ProfessionalTechnologyDao professionalTechnologyDao;

    public PageQuery<ProfessionalTechnology>queryByCondition(PageQuery query){
        PageQuery ret =  professionalTechnologyDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelProfessionalTechnology(List<Long> ids){
        try {
            professionalTechnologyDao.batchDelProfessionalTechnologyByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除ProfessionalTechnology失败", e);
        }
    }

    public List<ProfessionalTechnology> queryCompany(ProfessionalTechnologyQuery condtion){
        List<ProfessionalTechnology> ret =  professionalTechnologyDao.queryCompany(condtion);
        queryListAfter(ret);
        return ret;
    }
    public PageQuery<ProfessionalTechnology> queryEmployees(PageQuery page) {
        page.setPageSize(Integer.MAX_VALUE);

        PageQuery ret =  professionalTechnologyDao.queryEmployees(page);
        queryListAfter(ret.getList());
        return ret;
    }

    //查企业
    public PageQuery<ProfessionalTechnology>findenterprise(PageQuery query){
        PageQuery ret =  professionalTechnologyDao.findenterprise(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public PageQuery<ProfessionalTechnology> queryDoneTask(PageQuery page) {
        PageQuery ret =  professionalTechnologyDao.queryDoneTask(page);
        queryListAfter(ret.getList());
        return ret;

    }

    public int queryEmployeesCount(ProfessionalTechnologyQuery condition) {
        return professionalTechnologyDao.queryEmployeesCount(condition);
    }
}